#pragma once

#include "IXButton.h"



//////////////////////////////////////////////////////////////////////////
enum TabButtonStyle
{
    TBS_Custom,
    TBS_LeftText,
    TBS_TopText,
    TBS_RightText,
    TBS_BottomText,
    TBS_TextOnly,
    TBS_ImageOnly,
};


//////////////////////////////////////////////////////////////////////////

#define TAB_TITLE_MAX_LEN           MAX_PATH
#define TAB_IMAGE_PATH_MAX_LEN      MAX_PATH

class IXTabContent
{
public:
    virtual ~IXTabContent(){}

    virtual void OnGetBkImagePath(IN LPCTSTR szTabName, OUT LPTSTR szXNC, OUT INT* pnHCount, OUT INT* pnVCount) = 0;
    virtual void OnGetButtonInfo(IN LPCTSTR szTabName, OUT LPTSTR szTitle, OUT LPTSTR szImagePath, OUT TabButtonStyle* pStyle) = 0;
    virtual void OnCreateFrame(IN LPCTSTR szTabName, IN IXFrame* pFrame) = 0;
    virtual void OnShow(IN LPCTSTR szTabName, IN BOOL bShow) = 0;
};

/**
 *  IXTab Interface.
 *
 */

class ExportXSkinLib IXTab : public IXFrame
{
    DEF_INTERFACE(IXTab, _T("{CF751FE5-96E3-417e-89D7-C467B799FBF2}"));

public:
    virtual void    STDMETHODCALLTYPE   SetButtonMargin(int nMargin) = 0;
    virtual void    STDMETHODCALLTYPE   SetButtonSize(int nWidth, int nHeight) = 0;

    virtual void    STDMETHODCALLTYPE   SetTitleTextFont(IN IXFont* pFont) = 0;
    virtual void    STDMETHODCALLTYPE   SetTitleTextEnv(IN IXTextEnv* pTextEnv) = 0;
    virtual void    STDMETHODCALLTYPE   SetInternalMargin(IN int nLeft, IN int nTop, IN int nRight, IN int nBottom) = 0;

    virtual void    STDMETHODCALLTYPE   SetImageSize(IN int nImageWidth, IN int nImageHeight) = 0;

    virtual void    STDMETHODCALLTYPE   SetDirection(BOOL bHorz) = 0;

    virtual HRESULT STDMETHODCALLTYPE   InsertItem(int nIndex, LPCTSTR szTabName, IXTabContent* pContent) = 0;
    virtual HRESULT STDMETHODCALLTYPE   DeleteItem(LPCTSTR szTabName) = 0;

    virtual int     STDMETHODCALLTYPE   GetCurSel() = 0;
    virtual UINT    STDMETHODCALLTYPE   GetCount() = 0;

    virtual HRESULT STDMETHODCALLTYPE   ShowTab(IN LPCTSTR szTabName) = 0;

    virtual void    STDMETHODCALLTYPE   GetFrameRect(OUT RECT* prcFrame) = 0;
    virtual IXTabContent* STDMETHODCALLTYPE   GetContentByIndex(IN LPCTSTR szTabName) = 0;
};

